/**
 *
 */
package com.yangtao.prototype.system.domain;

import com.yangtao.framework.hibernate.BaseEntity;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

import javax.persistence.*;
import java.util.List;

/**
 * 页面元素
 *
 * @author 杨涛
 */
@Entity
@Table(name = "sys_page")
public class Page extends BaseEntity {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 页面编号，对应页面的代码名称
	 */
	@Column(length = 20)
	private String pageCode;
	/**
	 * 页面名称，代表页面的含义
	 */
	@Column(length = 30)
	private String pageName;
	/**
	 * 布局
	 */
	@Column(length = 8)
	private String layout;
	/**
	 * 样式
	 */
	@Column(length = 20)
	private String style;

	/**
	 * 页面功能简单描述
	 */
	@Column(length = 100)
	private String pageDesc;
	/**
	 * 产品代码
	 */
	@Column(length = 10)
	private String productCode;
	/**
	 * 模块代码
	 */
	@Column(length = 10)
	private String moduleCode;
	/**
	 * 功能代码
	 */
	@Column(length = 10)
	private String functionCode;
	/**
	 * 基本路径
	 */
	@Column(length = 20)
	private String basePath;

	@OneToMany(mappedBy = "page", fetch = FetchType.LAZY)
	@Cascade(CascadeType.ALL)
	private List<PageElement> elements;

	/**
	 * @return the layout
	 */
	public String getLayout() {
		return layout;
	}

	/**
	 * @param layout the layout to set
	 */
	public void setLayout(String layout) {
		this.layout = layout;
	}

	/**
	 * @return the style
	 */
	public String getStyle() {
		return style;
	}

	/**
	 * @param style the style to set
	 */
	public void setStyle(String style) {
		this.style = style;
	}

	/**
	 * @return the pageCode
	 */
	public String getPageCode() {
		return pageCode;
	}

	/**
	 * @param pageCode the pageCode to set
	 */
	public void setPageCode(String pageCode) {
		this.pageCode = pageCode;
	}

	/**
	 * @return the pageName
	 */
	public String getPageName() {
		return pageName;
	}

	/**
	 * @param pageName the pageName to set
	 */
	public void setPageName(String pageName) {
		this.pageName = pageName;
	}

	/**
	 * @return the pageDesc
	 */
	public String getPageDesc() {
		return pageDesc;
	}

	/**
	 * @param pageDesc the pageDesc to set
	 */
	public void setPageDesc(String pageDesc) {
		this.pageDesc = pageDesc;
	}

	/**
	 * @return the productCode
	 */
	public String getProductCode() {
		return productCode;
	}

	/**
	 * @param productCode the productCode to set
	 */
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}

	/**
	 * @return the moduleCode
	 */
	public String getModuleCode() {
		return moduleCode;
	}

	/**
	 * @param moduleCode the moduleCode to set
	 */
	public void setModuleCode(String moduleCode) {
		this.moduleCode = moduleCode;
	}

	/**
	 * @return the functionCode
	 */
	public String getFunctionCode() {
		return functionCode;
	}

	/**
	 * @param functionCode the functionCode to set
	 */
	public void setFunctionCode(String functionCode) {
		this.functionCode = functionCode;
	}

	/**
	 * @return the basePath
	 */
	public String getBasePath() {
		return basePath;
	}

	/**
	 * @param basePath the basePath to set
	 */
	public void setBasePath(String basePath) {
		this.basePath = basePath;
	}

	/**
	 * @return the elements
	 */
	public List<PageElement> getElements() {
		return elements;
	}

	/**
	 * @param elements the elements to set
	 */
	public void setElements(List<PageElement> elements) {
		this.elements = elements;
	}
}
